<?php 
if(isset($menu_thumbs) && is_array($menu_thumbs)){?>
<div class ="categories content">	
	<?php 
		$i = 0;
		foreach ($menu_thumbs as $key => $m) {
		if($m['slug'] != '/' && $m['slug'] != ""){
	?>
	<?php 
		$bg = $m['image']; 
		if(!empty($bg) && $bg != 'null'){
			$style = "background-image:url(/".Configure::read('Config.loacl_uploads_folder')."{$bg});";
			$anchor = '';
		}else{
			$style = "";
			$anchor = $m['name'];
		}
	?>
	<div class="grid_1 alpha">
		<div class="new_item actions bg_<?php echo $i?>">
			<?php 
				$url = ($m['slug'] != '/' && $m['slug'] != "") ? array('plugin'=>false,'controller'=>false,'action'=>$m['slug']) : $m['slug'];
				echo $this->Html->link($anchor, $this->Html->url($url,true),array('title'=>$m['title'],'class'=>'homepage-categories','style'=>$style));			
			?>
			<div class='clear'>&nbsp;</div>
		</div>
		<div class='clear'>&nbsp;</div>
	</div>
	<?php $i++;	}} ?>
	<div class='clear'>&nbsp;</div>
</div>
<?php }?>